﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Server.Engines.Dungeons
{
	public class DungeonInstance
	{
		private DateTime m_lastActivity;

		public DungeonDescription Description { get; private set; }

		public Region Region { get; private set; }

		public InstanceStatus Status { get; private set; }

		public DungeonInstance(DungeonDescription description)
		{
			Description = description;
			Region = new Region(Description.Name, Description.Map, 1, Description.Area);
			Status = InstanceStatus.Close;
		}

		public void OpenWorld()
		{
			Status = InstanceStatus.Open;
		}

		public int GetPlayerCount()
		{
			if (Status != InstanceStatus.Open)
				return 0;

			return Region.GetPlayerCount();
		}

		public DateTime GetLastActivityTime()
		{
			return m_lastActivity;
		}
	}

	public enum InstanceStatus
	{
		Close,
		Open,
		Deleted,
	}
}
